import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysHistoryInfo = (params) => {
  params.head.transCode = 'querySysHistoryInfo';
  return request({
    url: '/platform/sysHistoryInfo/querySysHistoryInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysHistoryInfoListPage = (params) => {
  params.head.transCode = 'querySysHistoryInfoListPage';
  return request({
    url: '/platform/sysHistoryInfo/querySysHistoryInfoListPage',
    method: 'post',
    data: params
  })
}

//根据指定字段查询集合
export const querySysHistoryInfoListMap = (params) => {
  params.head.transCode = 'querySysHistoryInfoListMap';
  return request({
    url: '/platform/sysHistoryInfo/querySysHistoryInfoListMap',
    method: 'post',
    data: params
  })
}

//新增单条记录
export const saveSysHistoryInfo = (params) => {
  params.head.transCode = 'saveSysHistoryInfo';
  return request({
    url: '/platform/sysHistoryInfo/saveSysHistoryInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysHistoryInfoList = (params) => {
  params.head.transCode = 'saveSysHistoryInfoList';
  return request({
    url: '/platform/sysHistoryInfo/saveSysHistoryInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysHistoryInfo = (params) => {
  params.head.transCode = 'saveOrUpdateSysHistoryInfo';
  return request({
    url: '/platform/sysHistoryInfo/saveOrUpdateSysHistoryInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysHistoryInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateSysHistoryInfoList';
  return request({
    url: '/platform/sysHistoryInfo/saveOrUpdateSysHistoryInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysHistoryInfo = (params) => {
  params.head.transCode = 'updateSysHistoryInfo';
  return request({
    url: '/platform/sysHistoryInfo/updateSysHistoryInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysHistoryInfo = (params) => {
  params.head.transCode = 'deleteSysHistoryInfo';
  return request({
    url: '/platform/sysHistoryInfo/deleteSysHistoryInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysHistoryInfoList = (params) => {
  params.head.transCode = 'deleteSysHistoryInfoList';
  return request({
    url: '/platform/sysHistoryInfo/deleteSysHistoryInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysHistoryInfoExcel = (params) => {
  downloadExcel({
    url: '/platform/sysHistoryInfo/excelDownload/exportSysHistoryInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
